home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tchk21.arc / INCLUDE.ARC / KEYBOARD.H < prev    next >
C/C++ Source or Header  |  1989-06-20  |  4KB  |  67 lines

  1. /* TCHK 2.1 - Howard Kapustein's Turbo C library        6-6-89      */
  2. /* Copyright (C) 1988,1989 Howard Kapustein.  All rights reserved.  */
  3.  
  4. /* keyboard.h  -  header file for KEYBOARD.C - keyboard input routines */
  5.  
  6. #ifndef KEYBOARD_HEADER
  7. #define KEYBOARD_HEADER 1
  8.  
  9. #include <howard.h>
  10.  
  11. #define SHIFT_STATUS    *((byte far *) 0x417lu)    /* key shift status */
  12. #define WAITFORKEY          1
  13. #define kbdclear()          clear_typeahead()
  14.  
  15. /* function prototypes */
  16. byte getk(boolean wait);      /* get key, like getchar() for IBM */
  17. int inkey(boolean wait);      /* get key, returns ASCII + 256 for extended */
  18. int inkeyc(boolean wait);     /* get key, returns ASCII + 256 for extended, all letters are Capitalized */
  19. int inkeydv(boolean wait);    /* get key, returns ASCII + 256 for extended, DESQview aware */
  20. int inkeycdv(boolean wait);   /* get key, returns ASCII + 256 for extended, all letters are Capitalized, DESQview aware */
  21. char getyn(int output);       /* get Yes/No, output = 0: no output */
  22. char getlogical(int output);  /* get True/False, output = 0: no output */
  23. char *getdatehk(void);        /* get date: 11/24/87 */
  24. char *getdouble(void);        /* get double */
  25. char *getint(void);           /* get integer */
  26. char *getreal(int size, int decimal);          /* get real number */
  27. char getc_match(boolean output, char *match);  /* get char, case matters, one of match */
  28. char getci_match(boolean output, char *match); /* get char, case independent, one of match */
  29. char getk_match(boolean output, char *match);  /* get key, one of match */
  30. boolean getpw(int size, char *pw, char c);     /* get a password, max size, display c */
  31. char *getstr(int size, char *pattern);  /* get a string, max size, pattern */
  32. int getget(int col, int row, char *returnstr, int size, char *pattern,
  33.            int argn, int argk[], unsigned flags);   /* get a string, max size, pattern, with editing */
  34.            /* Flags: xxxxxxxx UDJJBLRI = call _idle_get() during keyboard waits, DESQview free time slice, Justify mode, Bell */
  35.            /*                            Left/Right trim on exit, Insert mode on to start */
  36. #ifndef UDFIDLE                 /* also defined in MENUHK.H */
  37. #define UDFIDLE     0x0080      /* call user-defined function during keyboard wait */
  38. #endif
  39. #ifndef DVFREESLICE             /* also defined in MENUHK.H */
  40. #define DVFREESLICE 0x0040      /* free time slice during keyboard wait in DESQview */
  41. #endif
  42. #define JCENTER     0x0030
  43. #define JLEFT       0x0020
  44. #define JRIGHT      0x0010
  45. #define JNONE       0x0000
  46. #define BELL        0x0008
  47. #define TRIMLEFT    0x0004
  48. #define TRIMRIGHT   0x0002
  49. #define INSERTMODE  0x0001
  50. #define TRIMALL     TRIMLEFT|TRIMRIGHT
  51. #define NOFLAGS     0x0000
  52.            
  53. int clear_typeahead(void);      /* clears typeahead buffer, return # keys cleared */
  54. boolean isEnhanceKbd(void);       /* is keyboard the enahnced (100+ key) */
  55. int tocapkey(int k);            /* make keystroke uppercased */
  56. void InsLock(boolean on);       /* toggle Insert on? */
  57. void CapsLock(boolean on);      /* toggle Caps Lock on? */
  58. void NumLock(boolean on);       /* toggle Num Lock on? */
  59. void ScrollLock(boolean on);    /* toggle Scroll Lock on? */
  60. void keyclick(boolean on);      /* turn keyclick on/off (Jr, Convertible only) */
  61. void initkeyvars(void);         /* initialize keyboard variables */
  62. boolean isdate(int c);          /* Character classification macro (0-9 and - /) */
  63. boolean isfilename(int c);      /* Character classification macro (valid in DOS filename) */
  64. boolean ispathname(int c);      /* Character classification macro (valid in DOS filename) */
  65.  
  66. #endif              /* KEYBOARD_HEADER */
  67.